import axios from '@/api/fetch';
import SERVER from '@/api/server';

export const searchPartWaterByDto = params => axios.get(`${SERVER.DMSCLOUD_PART}/part/searchPartWaterByDto`, { params });

export const searchPartWaterDetail = params => axios.get(`${SERVER.DMSCLOUD_PART}/part/searchPartWaterDetail`, { params });

export const searchStroageList = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/BasicParametersAfterSales/findAllStroageCode`, { params });

// 导出
export const exportData = params => axios.get(`${SERVER.DMSCLOUD_PART}/part/export`, { params, responseType: 'blob' });
// 调拨入库打印接口
export const allInprint = (itemId, params, isFlow) => {
  return axios.get(`${SERVER.DMSCLOUD_PART}/allocation/queryInPrintData/${itemId}/${params}?isFlow=${isFlow.isFlow}`);
};
// 调拨出库打印接口
export const allOutPrint = (itemId, params) => {
  return axios.get(`${SERVER.DMSCLOUD_PART}/allocation/queryOutPrintData/${itemId}/${params}`);
};
// 根据工单号以及发料单号查询打印数据
export const queryPrintDataByRoNoOutStockNo = params => axios.get(`${SERVER.DMSCLOUD_PART}/basedata/ttRepairOrder/searchRoRepairPart`, { params });
// 打印数据获取退料
export const getExitPart = params => axios.get(`${SERVER.DMSCLOUD_PART}/basedata/ttRepairOrder/getExitPart`, { params });

// 打印数据获取领料出库单号
export const getOutStockNo = params => axios.get(`${SERVER.DMSCLOUD_PART}/basedata/ttRepairOrder/getOutStockNo`, { params });
// 打印销售单数据接口
export const salesPrint = params => axios.get(`${SERVER.DMSCLOUD_PART}/basedata/ttSalesPart/queryPrintSalesPartData/${params}`);
// 内部领用获取打印数据接口
export const internalPrint = (id, params) => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/partinners/queryPrintInnerData/${id}`, { params });
// 内部领用获取id
export const getInternalId = params => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/partinners/getInternalId`, { params });
// 根据报溢单号查询报溢明细
export const getProfitItem = params => axios.get(`${SERVER.DMSCLOUD_PART}/basedata/reportPayOff/findItemByPartProfit`, { params });
// 报损单查询
export const searchPartLoss = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partBreakage/queryPartLossItem`, {
    params
  });

//
export const searchPartInOutMax = params => axios.get(`${SERVER.DMSCLOUD_PART}/part/searchPartInOutMax`, { params });
